package com.ksd.pojo;

import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import java.util.Objects;

@Entity
public class Sms {
    private int id;
    private String username;
    private String sender;
    private String message;
    private String sendtime;
    private String isRead;

    @Id
    @Column(name = "ID")
    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    @Basic
    @Column(name = "username")
    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    @Basic
    @Column(name = "sender")
    public String getSender() {
        return sender;
    }

    public void setSender(String sender) {
        this.sender = sender;
    }

    @Basic
    @Column(name = "message")
    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    @Basic
    @Column(name = "sendtime")
    public String getSendtime() {
        return sendtime;
    }

    public void setSendtime(String sendtime) {
        this.sendtime = sendtime;
    }

    @Basic
    @Column(name = "isRead")
    public String getIsRead() {
        return isRead;
    }

    public void setIsRead(String isRead) {
        this.isRead = isRead;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        Sms sms = (Sms) o;
        return id == sms.id &&
                Objects.equals(username, sms.username) &&
                Objects.equals(sender, sms.sender) &&
                Objects.equals(message, sms.message) &&
                Objects.equals(sendtime, sms.sendtime) &&
                Objects.equals(isRead, sms.isRead);
    }

    @Override
    public int hashCode() {
        return Objects.hash(id, username, sender, message, sendtime, isRead);
    }
}
